

#include <iostream>
#include <sys/time.h>
#include <sys/resource.h>
#include <unistd.h>
#include <signal.h>
#include <jsoncpp/json/json.h>

#include "compile_run.hpp"
using namespace rs_compile_and_run;

// int main()
// {
//     Json::Value root;
//     root["code"] = "mycode";
//     root["usr"] = "lrl";
//     root["age"] = "18";

//     Json::FastWriter writer;
//     std::string str = writer.write(root);
//     std::cout << str << std::endl;

//     return 0;
// }

int main()
{

    Json::Value in_value;
    std::string in_json;

    in_value["code"] = R"(#include<iostream>
        int main(){
        std::cout << "hello" << std::endl;
        return 0;
        })";

    in_value["input"] = "";
    in_value["cpu_limit"] = 1;
    in_value["mem_limit"] = 10240 * 3;

    Json::StyledWriter writer;
    in_json = writer.write(in_value);


    std::string out_json;
    CompileAndRun::Start(in_json,&out_json);

    //std::cout << out_json << std::endl;

    return 0;
}